package win.smartown.app.util;

import android.app.Activity;
import android.content.Intent;

import java.util.HashMap;

/**
 * Created by smartown on 2017/3/18.
 * <br>
 * Description:
 */
public class JumpUtil {

    public static <T extends Activity> void startActivity(Activity activity, Class<T> activityClass, String title) {
        startActivity(activity, activityClass, title, null);
    }

    public static <T extends Activity> void startActivity(Activity activity, Class<T> activityClass, String title, HashMap<String, String> extras) {
        Intent intent = new Intent(activity, activityClass);
        intent.putExtra("title", title);
        if (extras != null) {
            for (String key : extras.keySet()) {
                intent.putExtra(key, extras.get(key));
            }
        }
        activity.startActivity(intent);
    }

}
